{% extends "themes/" + sysSettings.systemTheme + "/layout.html" %}

{% block head %}
<title>{{sysSettings.siteName}} - Local Authentication to oAuth</title>
{% endblock %}

{% block body %}
    <div class="container">
        <div class="row">
            <div class="col-sm-9 col-md-7 col-lg-5 mx-auto">
                <div class="card my-5 shadow text-left">
                    <form class="form" action="/oauth/convert/{{provider.name}}" method="POST">
                    <h5 class="card-header text-white bg-dark mb-3">
                        Local Authentication / oAuth Conversion
                    </h5>
                    <div class="card-body text-left">
                        <div>
                            <div>
                                A Local User Already Exists with the same email address. <br><br> To Convert from Local Authentication to {{provider.friendlyName}}, enter your Password Below:
                            </div>
                            <hr>
                            <div class="my-2">
                                <img class="shadow rounded float-left mr-3" src="/images/{{existingUser.pictureLocation}}" style="width:64px;height:64px;">
                              <span class="px-3"><br><b>{{existingUser.username}}</b></span>
                            </div><br>
                            <b><i class="fas fa-key"></i> Password</b><br>
                            <input class="form-control" type="password" name="password" id="password">
                            <input type="hidden" name="oAuthUsername" value="{{oAuthData[provider.username_value]}}">
                            <input type="hidden" name="oAuthID" value="{{oAuthData['id']}}">
                            <input type="hidden" name="existingUserID" value="{{existingUser.id}}">
                        </div>
                    </div>
                    <div class="card-footer text-right">
                        <a href="/login" class="btn btn-secondary">Cancel</a>
                        <input type="submit" class="btn btn-success" value="Convert">
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

{% endblock %}